 ### 加入购物车
# 请求网址:http://182.92.81.159:8080/wx/cart/add
# 请求方法:POST
# 请求头：
# Content-Type: application/json;charset=utf-8
# X-Litemall-Token:TOKEN
# 请求体：
# {"goodsId":1181000,"number":1,"productId":2}
# 返回数据：
import requests
resp=requests.post(url="http://192.168.65.135:8080/wx/auth/login",
              headers={"Content-Type":"application/json;charset=utf-8"},
              json={"username":"user123","password":"user123"})
token=resp.json()["data"]["token"]
a=requests.post(url="http://192.168.65.135:8080/wx/cart/add",
            headers={"Content-Type": "application/json;charset=utf-8",
                       "X-Litemall-Token":token},
               json={"goodsId":1181000,"number":1,"productId":2})
print(a.json())
